There are many situations where image scanning apparatus, such as a microscope, is used to obtain an image of a target. In many instances the depth of focus provided by the optical arrangement of the apparatus turns out to be less than the variation in the position of the target being scanned. This can be thought of as the height of the surface varying at different points within a scan by an amount greater than the depth of focus of the apparatus. In order to produce an image of the target the focus needs to be adjusted during the scan.
It is known in the art to generate a “focus map” for the target through a pre-scan. The focus is typically measured for a number of sample points along the target according to the point-focus technique by varying the objective lens through a predefined set of height values and calculating the height of maximum contrast. The focal height of the target between these points is then predicted using interpolation techniques to generate a focus map which is an estimation of an underlying focal surface. The drawback of this process is that rapid changes in focus require many points to be measured during a “pre-scan” before imagery data is acquired. This is of course time-consuming and can lower the productivity of the apparatus significantly. Alternatively, if too few points are measured, interpolated regions between the points in the focal map may fail to provide an adequate estimation of the focal surface and the target will appear out of focus in these regions.
U.S. Pat. No. 7,518,652 discusses examples of methods for generating a focus map of a target through the use of a pre-scan including a point-focus technique and a ribbon-focus technique. Focus maps generated by the ribbon-focus technique have been found to lack accuracy in regions of the target that have non-uniform tissue detail. This problem is twofold. Firstly, if the points at which the ribbon passes through the tissue focus lack detail the focus merit will remain low, meaning that a peak in the focus merit value will not be produced and so an in-focus point will not be found. Secondly, in the event that there is a region of high detail near to the focus (but not at the focus), whilst there is low detail when the ribbon is at the focus, a peak in the merit value will be produced at the out of focus detailed region, leading to an incorrect focus level measurement. These factors leads to a discrepancy between in the focus measurement positions calculated at points across the surface of the target and the actual focal surface of the target.